import AdminPage from '@/views/adminPage.vue'
import Index from '@/views/index.vue'
import UserPage from '@/views/userPage.vue'
import { createRouter, createWebHistory } from 'vue-router'


const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect:'/main'
    },
    {
      path: '/main', 
      component: Index,
      children: [
        {
          path: 'admin',
          component:AdminPage
        },
        {
          path: 'user',
          component:UserPage
        }
      ]
    }
  ],
})

export default router
